package com.xdqzy.baseline.demo.controller.param.resp;

import com.xdqzy.baseline.common.annotation.CombineField;
import com.xdqzy.baseline.demo.constant.ProductConstants;
import com.xdqzy.baseline.demo.model.ProductTypeModel;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author : winter
 * @version V1.0
 * @Title: 商品信息响应
 * @ClassName : com.xdqzy.baseline.demo.controller.param.resp.ProductDemoResp.java
 * @Description :
 * @date :  2020-11-15 22:49
 */
@ApiModel("商品信息响应")
@Data
public class ProductDemoResp {

    private String id;

    private String name;

    @CombineField(value = ProductConstants.PRODUCT_TYPE_COMBINE,convertField = "productTypeModel")
    private String productType;

    private BigDecimal price;

    private Date createTime;

    private String productTypeName;

    public void setProductTypeModel(ProductTypeModel productTypeModel) {
        this.productTypeName = productTypeModel.getTypeName();
    }
}
